/**
 * 
 */
package hihocoder;

import java.util.HashSet;
import java.util.Scanner;

/**
 * @author zhongfang
 *
 */
public class 本质不同的回文子串的数量 {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner scanner = new Scanner(System.in);
		String string = scanner.nextLine();
		scanner.close();
		int n = string.length();
		HashSet<String> set = new HashSet<>();

		for (int i = 0; i < n; i++) {
			String sBuilder = string.charAt(i) + "";
			set.add(sBuilder);
			// System.out.println(sBuilder);
			int j = i - 1;
			int k = i + 1;
			// 奇数
			while (j >= 0 && k < n) {
				if (string.charAt(j) == string.charAt(k)) {
					sBuilder = (string.charAt(j) + sBuilder + string.charAt(k));
					set.add(sBuilder);
					// System.out.println(sBuilder);
				} else {
					break;
				}
				j--;
				k++;
			}
			// 偶数
			j = i - 1;
			k = i + 1;
			if (j >= 0 && string.charAt(i) == string.charAt(j)) {
				sBuilder = "" + string.charAt(i) + string.charAt(j);
				set.add(sBuilder);
				j--;
				while (j >= 0 && k < n) {
					if (string.charAt(j) == string.charAt(k)) {
						sBuilder = (string.charAt(j) + sBuilder + string.charAt(k));
						set.add(sBuilder);
						// System.out.println(sBuilder);
					} else {
						break;
					}
					j--;
					k++;
				}
			}
			// 偶数2
			j = i - 1;
			k = i + 1;
			if (k < n && string.charAt(i) == string.charAt(k)) {
				sBuilder = "" + string.charAt(i) + string.charAt(i);
				set.add(sBuilder);
				k++;
				while (j >= 0 && k < n) {
					if (string.charAt(j) == string.charAt(k)) {
						sBuilder = (string.charAt(j) + sBuilder + string.charAt(k));
						set.add(sBuilder);
						// System.out.println(sBuilder);
					} else {
						break;
					}
					j--;
					k++;
				}
			}
		}
		System.out.println(set.size());
	}

}
